﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SW.EF.Core
{
    public static class Engine
    {
        private static IIocProvider _iocProvider;
        private static IAopProvider _aopProvider;
        private static IObjectMapperProvider _ojbMapperProvider;
        private static ILogProvider _logProvider;

        static Engine()
        {
            _iocProvider = new AutofacProvider();
            _aopProvider = new LinFuDynamicProxyProvider();
            _ojbMapperProvider = new AutoMapperProvider();
            _logProvider = new Log4NetProvider();
        }

        public static void SetIocProvider(IIocProvider iocProvider)
        {
            _iocProvider = iocProvider;
        }

        public static void SetAopProvider(IAopProvider aopProvider)
        {
            _aopProvider = aopProvider;
        }

        public static void SetObjMapperProvider(IObjectMapperProvider ojbMapperProvider)
        {
            _ojbMapperProvider = ojbMapperProvider;
        }

        public static void SetLogProvider(ILogProvider logProvider)
        {
            _logProvider = logProvider;
        }

        public static IIocProvider IocProvider { get { return _iocProvider; } }
        public static IAopProvider AopProvider { get { return _aopProvider; } }
        public static IObjectMapperProvider ObjMapperProvider { get { return _ojbMapperProvider; } }
        public static ILogProvider LogProvider { get { return _logProvider; } }
    }
}
